#ifndef _C_VISACTION_H__
#define _C_VISACTION_H__

#include "visbsc.h"
#include "vislist.h"

#ifdef  __cplusplus
extern "C" {
#endif

struct view;

typedef enum view_actionid
{
	vi_actionid_unknown = 0,
	vi_actionid_move_resize,
	vi_actionid_show,
	vi_actionid_hide,
}
view_actionid_e;

typedef struct vi_action_move_resize_data
{
	int orig_left;
	int orig_top;
	int orig_width;
	int orig_height;
}
vi_action_move_resize_data_t;

union view_action_dataset
{
	// for move and resize
	vi_action_move_resize_data_t move_resize;
	// show/hide do not have a dataset
};

typedef struct view_action_data
{
	view_actionid_e actionid;
	union view_action_dataset u;
}
view_action_data_t;

typedef struct view_action_node
{
	listnode_t ownerlist;
	view_action_data_t data;
}
view_action_node_t;

typedef struct view_action_head
{
	listnode_t ownerlist;
	listnode_t actionlist;
	struct view* vi;
}
view_action_head_t;

// functions
int view_add_action(struct view* vi, view_action_data_t* actdata);

#ifdef  __cplusplus
}
#endif

#endif /* _C_VISACTION_H__ */
/* EOF */
